<!DOCTYPE html>
<html lang="en">
  <head>
    <title>AutoPurgingImageCache Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Class/AutoPurgingImageCache" class="dashAnchor"></a>

    <a title="AutoPurgingImageCache Class Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          AlamofireImage 4.2.0 Docs
        </a>
         (77% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/Alamofire/AlamofireImage">
            <img class="header-icon" src="../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="dash-feed://https%3A%2F%2Falamofire.github.io%2FAlamofireImage%2Fdocsets%2FAlamofireImage.xml">
            <img class="header-icon" src="../img/dash.png"/>
            Install in Dash
          </a>
        </p>
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">AlamofireImage Reference</a>
      <img class="carat" src="../img/carat.png" />
      AutoPurgingImageCache Class Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/AutoPurgingImageCache.html">AutoPurgingImageCache</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/ImageDownloader.html">ImageDownloader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/ImageDownloader/DownloadPrioritization.html">– DownloadPrioritization</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/ImageResponseSerializer.html">ImageResponseSerializer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RequestReceipt.html">RequestReceipt</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/AFIError.html">AFIError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/AlamofireExtension.html">AlamofireExtension</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/DataRequest.html">DataRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/DataRequest.html">DataRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UIButton.html">UIButton</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UIImage.html">UIImage</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UIImageView.html">UIImageView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UIImageView/ImageTransition.html">– ImageTransition</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/CompositeImageFilter.html">CompositeImageFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/CoreImageFilter.html">CoreImageFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/ImageCache.html">ImageCache</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/ImageFilter.html">ImageFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/ImageRequestCache.html">ImageRequestCache</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/Roundable.html">Roundable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/Sizable.html">Sizable</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/AspectScaledToFillSizeCircleFilter.html">AspectScaledToFillSizeCircleFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/AspectScaledToFillSizeFilter.html">AspectScaledToFillSizeFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/AspectScaledToFillSizeWithRoundedCornersFilter.html">AspectScaledToFillSizeWithRoundedCornersFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/AspectScaledToFitSizeFilter.html">AspectScaledToFitSizeFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/BlurFilter.html">BlurFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/CircleFilter.html">CircleFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DynamicCompositeImageFilter.html">DynamicCompositeImageFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DynamicImageFilter.html">DynamicImageFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/RoundedCornersFilter.html">RoundedCornersFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/ScaledToSizeCircleFilter.html">ScaledToSizeCircleFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/ScaledToSizeFilter.html">ScaledToSizeFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/ScaledToSizeWithRoundedCornersFilter.html">ScaledToSizeWithRoundedCornersFilter</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:14AlamofireImage15AFIDataResponsea">AFIDataResponse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:14AlamofireImage9AFIResulta">AFIResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:14AlamofireImage16AnimationOptionsa">AnimationOptions</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:14AlamofireImage12ControlStatea">ControlState</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/Image">Image</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:14AlamofireImage0B0a">Image</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>AutoPurgingImageCache</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">AutoPurgingImageCache</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/ImageRequestCache.html">ImageRequestCache</a></span></code></pre>

                </div>
              </div>
            <p>The <code>AutoPurgingImageCache</code> in an in-memory image cache used to store images up to a given memory capacity. When
the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously
purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the
internal access date of the image is updated.</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Properties"></a>
                <a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Properties"></a>
                  <h3 class="section-name"><p>Properties</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC11memoryUsages6UInt64Vvp"></a>
                    <a name="//apple_ref/swift/Property/memoryUsage" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC11memoryUsages6UInt64Vvp">memoryUsage</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The current total memory usage in bytes of all images stored within the cache.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">open</span> <span class="k">var</span> <span class="nv">memoryUsage</span><span class="p">:</span> <span class="kt">UInt64</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC14memoryCapacitys6UInt64Vvp"></a>
                    <a name="//apple_ref/swift/Property/memoryCapacity" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC14memoryCapacitys6UInt64Vvp">memoryCapacity</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The total memory capacity of the cache in bytes.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">memoryCapacity</span><span class="p">:</span> <span class="kt">UInt64</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC30preferredMemoryUsageAfterPurges6UInt64Vvp"></a>
                    <a name="//apple_ref/swift/Property/preferredMemoryUsageAfterPurge" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC30preferredMemoryUsageAfterPurges6UInt64Vvp">preferredMemoryUsageAfterPurge</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory
capacity drops below this limit.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">preferredMemoryUsageAfterPurge</span><span class="p">:</span> <span class="kt">UInt64</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Initialization"></a>
                <a name="//apple_ref/swift/Section/Initialization" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Initialization"></a>
                  <h3 class="section-name"><p>Initialization</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC14memoryCapacity30preferredMemoryUsageAfterPurgeACs6UInt64V_AGtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(memoryCapacity:preferredMemoryUsageAfterPurge:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC14memoryCapacity30preferredMemoryUsageAfterPurgeACs6UInt64V_AGtcfc">init(memoryCapacity:<wbr>preferredMemoryUsageAfterPurge:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initializes the <code>AutoPurgingImageCache</code> instance with the given memory capacity and preferred memory usage
after purge limit.</p>

<p>Please note, the memory capacity must always be greater than or equal to the preferred memory usage after purge.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">memoryCapacity</span><span class="p">:</span> <span class="kt">UInt64</span> <span class="o">=</span> <span class="mi">100_000_000</span><span class="p">,</span> <span class="nv">preferredMemoryUsageAfterPurge</span><span class="p">:</span> <span class="kt">UInt64</span> <span class="o">=</span> <span class="mi">60_000_000</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>memoryCapacity</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The total memory capacity of the cache in bytes. <code>100 MB</code> by default.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>preferredMemoryUsageAfterPurge</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The preferred memory usage after purge in bytes. <code>60 MB</code> by default.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The new <code>AutoPurgingImageCache</code> instance.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Add%20Image%20to%20Cache"></a>
                <a name="//apple_ref/swift/Section/Add Image to Cache" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Add%20Image%20to%20Cache"></a>
                  <h3 class="section-name"><p>Add Image to Cache</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC3add_3for14withIdentifierySo7UIImageC_10Foundation10URLRequestVSSSgtF"></a>
                    <a name="//apple_ref/swift/Method/add(_:for:withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC3add_3for14withIdentifierySo7UIImageC_10Foundation10URLRequestVSSSgtF">add(_:<wbr>for:<wbr>withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Adds the image to the cache using an identifier created from the request and optional identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">add</span><span class="p">(</span><span class="n">_</span> <span class="nv">image</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:14AlamofireImage0B0a">Image</a></span><span class="p">,</span> <span class="k">for</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">,</span> <span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>image</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The image to add to the cache.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The request used to generate the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The additional identifier to append to the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC3add_14withIdentifierySo7UIImageC_SStF"></a>
                    <a name="//apple_ref/swift/Method/add(_:withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC3add_14withIdentifierySo7UIImageC_SStF">add(_:<wbr>withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Adds the image to the cache with the given identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">add</span><span class="p">(</span><span class="n">_</span> <span class="nv">image</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:14AlamofireImage0B0a">Image</a></span><span class="p">,</span> <span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>image</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The image to add to the cache.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The identifier to use to uniquely identify the image.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Remove%20Image%20from%20Cache"></a>
                <a name="//apple_ref/swift/Section/Remove Image from Cache" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Remove%20Image%20from%20Cache"></a>
                  <h3 class="section-name"><p>Remove Image from Cache</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC06removeB03for14withIdentifierSb10Foundation10URLRequestV_SSSgtF"></a>
                    <a name="//apple_ref/swift/Method/removeImage(for:withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC06removeB03for14withIdentifierSb10Foundation10URLRequestV_SSSgtF">removeImage(for:<wbr>withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Removes the image from the cache using an identifier created from the request and optional identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">open</span> <span class="kd">func</span> <span class="nf">removeImage</span><span class="p">(</span><span class="k">for</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">,</span> <span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The request used to generate the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The additional identifier to append to the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if the image was removed, <code>false</code> otherwise.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC12removeImages8matchingSb10Foundation10URLRequestV_tF"></a>
                    <a name="//apple_ref/swift/Method/removeImages(matching:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC12removeImages8matchingSb10Foundation10URLRequestV_tF">removeImages(matching:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Removes all images from the cache created from the request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">open</span> <span class="kd">func</span> <span class="nf">removeImages</span><span class="p">(</span><span class="n">matching</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The request used to generate the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if any images were removed, <code>false</code> otherwise.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC06removeB014withIdentifierSbSS_tF"></a>
                    <a name="//apple_ref/swift/Method/removeImage(withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC06removeB014withIdentifierSbSS_tF">removeImage(withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Removes the image from the cache matching the given identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">open</span> <span class="kd">func</span> <span class="nf">removeImage</span><span class="p">(</span><span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The unique identifier for the image.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if the image was removed, <code>false</code> otherwise.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC15removeAllImagesSbyF"></a>
                    <a name="//apple_ref/swift/Method/removeAllImages()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC15removeAllImagesSbyF">removeAllImages()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Removes all images stored in the cache.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">@objc</span>
<span class="kd">open</span> <span class="kd">func</span> <span class="nf">removeAllImages</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if images were removed from the cache, <code>false</code> otherwise.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Fetch%20Image%20from%20Cache"></a>
                <a name="//apple_ref/swift/Section/Fetch Image from Cache" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Fetch%20Image%20from%20Cache"></a>
                  <h3 class="section-name"><p>Fetch Image from Cache</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC5image3for14withIdentifierSo7UIImageCSg10Foundation10URLRequestV_SSSgtF"></a>
                    <a name="//apple_ref/swift/Method/image(for:withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC5image3for14withIdentifierSo7UIImageCSg10Foundation10URLRequestV_SSSgtF">image(for:<wbr>withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the image from the cache associated with an identifier created from the request and optional identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">image</span><span class="p">(</span><span class="k">for</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">,</span> <span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Typealiases.html#/s:14AlamofireImage0B0a">Image</a></span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The request used to generate the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The additional identifier to append to the image&rsquo;s unique identifier.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The image if it is stored in the cache, <code>nil</code> otherwise.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC5image14withIdentifierSo7UIImageCSgSS_tF"></a>
                    <a name="//apple_ref/swift/Method/image(withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC5image14withIdentifierSo7UIImageCSgSS_tF">image(withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the image in the cache associated with the given identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">image</span><span class="p">(</span><span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Typealiases.html#/s:14AlamofireImage0B0a">Image</a></span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The unique identifier for the image.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The image if it is stored in the cache, <code>nil</code> otherwise.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Image%20Cache%20Keys"></a>
                <a name="//apple_ref/swift/Section/Image Cache Keys" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Image%20Cache%20Keys"></a>
                  <h3 class="section-name"><p>Image Cache Keys</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14AlamofireImage011AutoPurgingB5CacheC05imageE3Key3for14withIdentifierSS10Foundation10URLRequestV_SSSgtF"></a>
                    <a name="//apple_ref/swift/Method/imageCacheKey(for:withIdentifier:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14AlamofireImage011AutoPurgingB5CacheC05imageE3Key3for14withIdentifierSS10Foundation10URLRequestV_SSSgtF">imageCacheKey(for:<wbr>withIdentifier:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the unique image cache key for the specified request and additional identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">imageCacheKey</span><span class="p">(</span><span class="k">for</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">,</span> <span class="n">withIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The request.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>identifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The additional identifier.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The unique image cache key.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2021 <a class="link" href="http://alamofire.org/" target="_blank" rel="external">Alamofire Software Foundation</a>. All rights reserved. (Last updated: 2021-04-03)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
